angular.module('wechat', ['ionic', 'wechat.controllers', 'wechat.services', 'wechat.routes'])
    .config(['$ionicConfigProvider', function ($ionicConfigProvider) {
        $ionicConfigProvider.tabs.position('bottom');
    }])
    .run(function ($ionicPlatform, $http, messageService, dateService) {
        var url = "";
        if (ionic.Platform.isAndroid()) {
            url = "/android_asset/www/";
        }
        $http.get(url + "data/json/messages.json").then(function (response) {
            console.log(response.data.messages);
            messageService.init(response.data.messages);
        });
        $http.get(url + "data/json/friends.json").then(function (response) {

        });
        $ionicPlatform.ready(function () {
            if (window.cordova && window.cordova.plugins.Keyboard) {
                cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
            }
            if (window.StatusBar) {
                StatusBar.styleDefault();
            }
        })
    })